﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Audio;
using Microsoft.Xna.Framework.Content;
using Microsoft.Xna.Framework.GamerServices;
using Microsoft.Xna.Framework.Graphics;
using Microsoft.Xna.Framework.Input;
using Microsoft.Xna.Framework.Media;

namespace WingsOverSpace
{
    class Background : DrawableGameComponent
    {
        private Texture2D backgroundTexture;
        public Vector2 backgroundPos = new Vector2(0, 0);
        public Rectangle Size;
        public float scale = 1.0f;

        public Background(Game g) : base(g) { }

        public void LoadContent(ContentManager contentManager, string bgname)
        {
            backgroundTexture = contentManager.Load<Texture2D>(bgname);
            Size = new Rectangle(0, 0, (int)(backgroundTexture.Width * scale), (int)(backgroundTexture.Height * scale));
        }

        public void Draw(SpriteBatch spriteBatch)
        {
            spriteBatch.Draw(backgroundTexture, backgroundPos, new Rectangle(0, 0, backgroundTexture.Width, backgroundTexture.Height), Color.White, 0.0f, Vector2.Zero, scale, 
                SpriteEffects.None, 0);
        }



    }
}
